<!--<div class="layui-footer">-->
<!--    &lt;!&ndash; 底部固定区域 &ndash;&gt;-->
<!--    底部固定区域-->
<!--</div>-->

<script>
    //JS
    layui.use(['element', 'layer', 'util'], function(){
        var element = layui.element
            ,layer = layui.layer
            ,util = layui.util
            ,$ = layui.$;

        //头部事件
        util.event('lay-header-event', {
            //左侧菜单事件
            menuLeft: function(othis){
                layer.msg('展开左侧菜单的操作', {icon: 0});
            }
            ,menuRight: function(){

                layer.open({
                    type: 1
                    ,content: '<div id="msgList"></div>'
                    ,area: ['260px', '100%']
                    ,offset: 'rt' //右上角
                    ,anim: 5
                    ,shadeClose: true
                });
                var html = '';
                $.ajax({
                    url: "http://1.117.149.125:81/api/msgList",
                    type: "GET",
                    data:{
                        'data':'',
                    },
                    dataType: "json",
                    success: function(data){
                        data['data'].forEach(function(item) {
                            console.log(item);
                            html += '<div style="padding: 15px;">'+item['content']+'</div>';
                        });
                        $('#msgList').html(html);
                    },
                    error:function(err){
                        console.log(err.statusText);
                    }
                });
            }
        });

    });
</script>